<?php
interface Shoppingcart_Models_Interface_Cart
{

    /**
    *Get all cart
    *@return Tomato_Model_Recordset
    **/
    public function getCart();

    /**
    * Get last cart id to set cookie value
    * @return int
    **/
    public function getLastId();

    /**
    * Get cart by id
    * @param: $id Id of cart
    * @return Shopping_Models_Cart
    **/
    public function getById($id);

    /**
    * Get cart detail info by id
    * @param: $id Id of cart
    * @return Tomato_Model_Recordset
    **/
    public function getDetailById($id);

    /**
    * Add new cart
    * @param: $cart Cart_Models_Cart
    * @return void
    **/
    public function add($cart);

    /**
    * Add new cart detail
    * @param: $cart Cart_Models_Cart
    * @return: int
    **/
    public function addDetail($cart);

    /**
    * Update cart
    * @param: $cart Cart_Models_Cart
    * @return: void
    **/
    public function update($cart);

    /**
    * Update cart detail
    * @param: $cart Cart_Models_Cart
    * @return: void
    **/
    public function updateDetail($cart);

    /**
     * Update quantity for cart detail
     * @param: $cart Shoppingcart_Models_Cart
     * @return: void
     **/
    public function updateQuantiy($cart);

    /**
    * Delete cart and delete all cart details belong this cart
    * @param: $id Is cart_id
    * @return: void
    **/
    public function delete($id);

    /**
     * Delete a cart detail
     * @param: $id Id of cart detail
     * @return: void
     **/
    public function deleteDetail($id);

    /**
     * Get product info by language and id
     * Return product info of current language
     * @param: $id Id of product
     * @return: Tomato_Model_Recordset
     **/
    public function getProductById($id);

    /**
     * Check file exist in directory
     * Return new file
     * @param: $path Path file to directory
     * example: $path = 'C:\wamp\www\hoalan\upload\page\admin\2010\11\4ce0f0a438085_large.jpg'
     * @param: $file Path file formt server
     * example: $file = 'http://localhost/hoalan/upload/page/admin/2010/11/4ce0f0a438085_large.jpg'
     * @param: $name New file name
     * $name = 'square' is FROm 4ce0f0a438085_large.jpg TO 4ce0f0a438085_square.jpg
     * @return string
    **/
    public function checkFile($path, $file, $name = 'square');

    /**
     * Update auto increment
     * Condition last id > 4.200.000.000
    **/
    public function resetAutoIncrement();
}
